package com.erpanderp.pr.model.entity

class PurchaseRequestItem {

	static belongsTo=[purchaseRequest:PurchaseRequest]
	static hasMany=[accountAssignments:AccountAssignment]	

	Integer itemNumber	
	String accountAssignmentCategory	
	String itemCategory	
	String material	
	String shortText	
	Double quantity	
	String unit	
	Date deliveryDate	
	String materialGroup	
	String plant	
	String storageLocation	
	String purchasingGroup	
	String desiredVendor
		
	Date dateCreated	
	Date lastUpdated	
	String createdBy	
	String lastUpdatedBy	

    static constraints = {
    	itemNumber()
    	accountAssignmentCategory(maxSize: 1)
    	itemCategory(maxSize: 1)
    	material(maxSize: 18)
    	shortText(maxSize: 40)
    	quantity(scale: 3)
    	unit(maxSize: 3)
    	materialGroup(maxSize: 3)
    	plant(maxSize: 4)
    	storageLocation(maxSize: 4)
    	purchasingGroup(maxSize: 3)
    	desiredVendor(maxSize: 10)
    	createdBy(maxSize: 255)
    	lastUpdatedBy(maxSize: 255)
    }
}
